package DataModel
{
	import tristate.TsState;
	
	public class QualificationRecord
	{
		private var m_strQualification:String;
		private var m_strField:String;
		private var m_strInstitution:String;
		private var m_strInstitutionType:String;
		private var m_strYear:String;
		private var m_strDocs:String;
		private var m_tsstateDocState:TsState;
		private var m_nIndex:int;


		public static function compare(lhs:Object, rhs:Object):int
		{
			return (lhs as QualificationRecord).m_nIndex - (rhs as QualificationRecord).m_nIndex;
		}

		public function QualificationRecord(strInstitutionType:String = "",
											strInstitution:String = "",
											strField:String = "",
											strQualification:String = "",
											date:String = "",
											strDocs:String="",
											tsstateDoc:TsState=null,
											ndx:int = -1)
		{
			m_strInstitutionType = strInstitutionType;
			m_strInstitution = strInstitution;
			m_strField = strField;
			m_strQualification = strQualification;
			m_strYear = date;
			m_strDocs = strDocs;
			m_tsstateDocState = tsstateDoc == null ? TsState.Unchecked : tsstateDoc;
			m_nIndex = ndx;
		}
		public function get ndx():int
		{
			return m_nIndex;
		} 
		public function set ndx(intVal:int):void
		{
			m_nIndex = intVal;
			SkillsAuditDocument.instance.dirtyForm = true;
		}
		public function get qualification():String
		{
			if (m_strQualification == null) {
				return "";
			}
			return m_strQualification;
		} 
		public function set qualification(strVal:String):void
		{
			m_strQualification = strVal;
			SkillsAuditDocument.instance.dirtyForm = true;
		}
		
		public function get institution():String
		{
			if (m_strInstitution == null) {
				return "";
			}
			return m_strInstitution;
		} 
		public function set institution(strVal:String):void
		{
			m_strInstitution = strVal;
			SkillsAuditDocument.instance.dirtyForm = true;
		}

		public function get institutionType():String
		{
			if (m_strInstitutionType == null) {
				return "";
			}
			return m_strInstitutionType;
		} 
		public function set institutionType(strVal:String):void
		{
			m_strInstitutionType = strVal;
			SkillsAuditDocument.instance.dirtyForm = true;
		}

		public function get field():String
		{
			if (m_strField == null) {
				return "";
			}
			return m_strField;
		} 
		public function set field(strVal:String):void
		{
			m_strField = strVal;
			SkillsAuditDocument.instance.dirtyForm = true;
		}

		public function get yearCompleted():String
		{
			return m_strYear;
		} 
		public function set yearCompleted(strVal:String):void
		{
			m_strYear = strVal;
			SkillsAuditDocument.instance.dirtyForm = true;
		}

		public function get documents():String
		{
			return m_strDocs;
		} 
		public function set documents(strVal:String):void
		{
			m_strDocs = strVal;
			SkillsAuditDocument.instance.dirtyForm = true;
		}

		public function get documentState():TsState
		{
			return m_tsstateDocState;
		}
		public function set documentState(tsVal:TsState):void
		{
			m_tsstateDocState = tsVal;
			SkillsAuditDocument.instance.dirtyForm = true;
		}

	}
}